package com.gouaixin.bee.beeframework2.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.google.gson.Gson;
import com.gouaixin.bee.beeframework2.R;
import com.gouaixin.bee.beeframework2.bean.AbiType;
import com.gouaixin.bee.beeframework2.bean.Goods_id;
import com.gouaixin.bee.beeframework2.bean.Pay;
import com.gouaixin.bee.beeframework2.model.MemberModel;
import com.gouaixin.bee.beeframework2.tool.PreferencesUtils;
import com.gouaixin.bee.beeframework2.tool.mLog;

/**
 * Created by Administrator on 2015/3/10.
 */
//我的爱币界面
public class B13_aiBiActivity extends FragmentActivity {
    Context context=B13_aiBiActivity.this;
    String titleName;

    TextView kt01,kt02,kt03;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.b13_aibi);

        cid= PreferencesUtils.getString(context, "cid");


        initView();

        initHead();
        initContent();

        setListener();

    }
    private String order_name="",order_price="";
    private int goods_id;//商品的唯一id
    Pay bean=new Pay();
    String cid="";
    Intent it;

    private void setListener() {
        kt01.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                MemberModel.abiSuccess(context, AbiType.Type_100);
                order_name="购买50000爱币";
                order_price="500";

                bean.setAmount(order_price);
                bean.setCid(cid);
                bean.setTradeName(order_name);
                bean.setGoods_id(Goods_id.Aibi_500);

                it=new Intent(context,F1_PaySelectActivity.class);
                it.putExtra("pay",new Gson().toJson(bean));
                mLog.e("vip界面传出的pay=" + new Gson().toJson(bean));
                startActivity(it);
            }
        });

        kt02.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                MemberModel.abiSuccess(context, AbiType.Type_300);
                order_name="购买50000爱币";
                order_price="500";

                bean.setAmount(order_price);
                bean.setCid(cid);
                bean.setTradeName(order_name);
                bean.setGoods_id(Goods_id.Aibi_500);

                it=new Intent(context,F1_PaySelectActivity.class);
                it.putExtra("pay",new Gson().toJson(bean));
                mLog.e("vip界面传出的pay=" + new Gson().toJson(bean));
                startActivity(it);
            }
        });

        kt03.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                MemberModel.abiSuccess(context, AbiType.Type_500);
                order_name="购买50000爱币";
                order_price="500";

                bean.setAmount(order_price);
                bean.setCid(cid);
                bean.setTradeName(order_name);
                bean.setGoods_id(Goods_id.Aibi_500);

                it=new Intent(context,F1_PaySelectActivity.class);
                it.putExtra("pay",new Gson().toJson(bean));
                mLog.e("vip界面传出的pay=" + new Gson().toJson(bean));
                startActivity(it);
            }
        });




    }


    private void initView() {
        kt01= (TextView) findViewById(R.id.kt01);
        kt02= (TextView) findViewById(R.id.kt02);
        kt03= (TextView) findViewById(R.id.kt03);

    }



    /***
     * 内容区域的监听
     */
    private void initContent() {

    }

    /***
     * 头部的监听
     */
    private void initHead() {
        //顶部
        ImageView back;//返回
        TextView title;//标题

        back= (ImageView) findViewById(R.id.back);
        title= (TextView) findViewById(R.id.title);



        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}
